<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="reset.css">
    <link rel="stylesheet" href="details.css">
</head>

<body>
    <div class="nav">
        <div class="nav-center">
            <div class="cy">
                <img src="img/cy.png" alt="">
                <span>网络全案营销服务提供商</span>
            </div>
            <ul>
                <li>网站首页</li>
                <li>传悦资源</li>
                <li class="select">传悦案例</li>
                <li>传悦服务</li>
                <li>解决方案</li>
                <li>需求提交</li>
            </ul>
            <div class="talk">
                <span><img src="img/tel.jpg" alt=""></span>
                <span>0934-234567</span>
                <span><img src="img/qq.jpg" alt=""></span>
                <span><img src="img/wb.jpg" alt=""></span>
                <span><img src="img/weixin.png" alt=""></span>
                <span><img src="img/youxiang.jpg" alt=""></span>
            </div>
        </div>
    </div>
    <div class="center">
        <h2 id="title"></h2>
        <div class="cont" id="content">
        </div>
        <div class="footer">
            <span>上一个：开门红商场基础营销</span>
            <span>下一个：金数据全网整合营销</span>
        </div>
    </div>

    <script src="jquery.min.js"></script>
    <script>
        String.prototype.parseUrl = function() {
            let arr = this.slice(this.indexOf("?") + 1).split("&");
            let result = {};
            arr.forEach(item => {
                let key = item.split("=")[0];
                let value = item.split("=")[1];
                result[key] = value;
            })
            return result;
        }

        $.ajax({
            url: "http://10.35.170.196:81/getNews",
            data: {
                id: location.href.parseUrl().id
            },
            success(data) {
                $("#title").html(data.title);
                $("#content").html(data.content);
                console.log(data)
            }
        })
    </script>
</body>

</html>